Skip to content

fix(studio): a PageShell row with nothing of its own draws no lone hairline; pin the title-row tenants outside studio-design - #37542

Draft
objectstack-fleet[bot] wants to merge 3 commits into
mainfrom
claude/issue-37520-studio-title-row-pins
Draft

objectstack-fleet[bot] wants to merge 3 commits into
mainfrom
claude/issue-37520-studio-title-row-pins

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #37520

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:应用搭建里元数据列表页和详情页的标题行,若这一行自己没有按钮或统计,末尾 AI 助手按钮前不再多画一条孤零零的分隔竖线;其余全是测试补强,用户无感。
  • 为什么做:属于「Studio 顶栏迁出」这一系列工作的收尾:上一轮把保存和 AI 按钮搬进了各页标题行,但其中几处位置、面板开关、深色模式和多页面同时挂载的配色计数都没有测试守护,删掉也不会有任何报警。
  • 出错会怎样:最坏情况是某个标题行多一条或少一条分隔竖线,不涉及数据和权限,可以直接撤回。
  • 要你做什么:无。

What changes

Pins for the Studio title-row tenants that PR #37474 placed outside studio-design/**, plus one product change (N3), as the contract record on #37474 asked (findings S1, S2, N1, N3, N4).

  • N3 (product, PageShell.tsx only): both PageShell rows (compact and list) now pass divider to StudioTitleRowEnd, computed from the row's own stats and actions. A row with neither draws the assistant with no hairline before it; Save still brings the hairline, as StudioTitleRowEnd already counts it as an action. This matches what the item header and the directory header already do. Outside Studio nothing changes (the row end draws nothing there).
  • S1: with no copilot served, the slot toggle (studio-slot-toggle) ends the flow page's title row behind a hairline, is absent from the top bar, is the only one on the page, and hides and shows the slot (aria-pressed and accessible name follow). Control: with a copilot served the same row ends with the AI assistant and no toggle.
  • S2: PageShell's compact row (actions, Save, hairline, assistant, in the right-aligned group) and the !embedded gate on both rows (an embedded row draws neither Save nor the assistant); the directory header (assistant with no hairline; Save then hairline then assistant; control outside Studio); the diagnostics header (assistant last, after Refresh, behind a hairline; control outside Studio).
  • N1: two components holding the accent on body, one unmounted: body keeps the classes and the marker; the last unmount removes both. Control: one mount and unmount leaves body as found.
  • N4: dark mode as far as the DOM can say it: the dark: variant is read from the app shell's stylesheet; under the dark class on the page root, the surface root and body both match the variant and carry the accent's dark declarations (graphite --primary and --ring from STUDIO_ACCENT_HSL.dark). Control: under the light theme neither matches.

Each new pin went into the existing harness file for its component as a top-level describe (ruling record 6583487846), so no new test file is added.

Read first (by risk):

  1. ui/packages/app-shell/src/views/metadata-admin/PageShell.tsx, the rowHasOwnControls hunk: the only product line.
  2. StudioDesignSurface.graphite-37455.test.tsx, the dark-variant block: it reads styles.css and matches the variant selector by selector (see Acceptance notes).
  3. StudioDesignSurface.pillarsClaimSlot-12725.test.tsx, the S1 block.

Two-minute check: cd ui && pnpm --filter @object-ui/app-shell exec vitest run --root ../.. packages/app-shell/src/views/metadata-admin/PageShell.narrowHeader-12306.test.tsx shows 13 passed, among them the two N3 cases.

Tests

All on head b74f7ff4c7. Nine ablations, each through scripts/ablation-replace.mjs (mutation proven on disk, restore proven against HEAD), each turned its pin red:

Ablation Mutation Red cases
A1 slot toggle the toggle arm returns null when no copilot is served (StudioDesignSurface.tsx, mutation only, restored) S1 case
A2 compact row end the compact row's StudioTitleRowEnd replaced by null 4 (compact order, N3 compact, N3 stats control, Save control)
A3 compact embedded gate !embedded && dropped on the compact row embedded compact row
A4 list embedded gate !embedded && dropped on the list row embedded list row
A5 N3 guard rowHasOwnControls = true 2 (N3 compact, N3 list)
A6 directory row end its StudioTitleRowEnd deleted 2 (both directory cases)
A7 diagnostics row end its StudioTitleRowEnd deleted diagnostics case
A8 accent counter the mountedSurfaces > 0 early return deleted (plain add/remove) two-mount / one-unmount case
A9 dark declarations dark:[--primary:220_9%_83%] removed from STUDIO_ACCENT dark-theme case

(A2's first attempt was refused by the tool before any run, because its replacement was a suffix of its anchor; it was rerun with a distinct replacement, row above.)

Suite and typecheck readings
  • The five touched suites plus every app-shell test that renders PageShell or reads the row end, divider or toggle (15 files): Test Files 15 passed (15), Tests 240 passed (240).
  • pnpm --filter @object-ui/app-shell type-check (both tsc --noEmit and tsc -p tsconfig.test.json, which compiles the tests): VERDICT command-exit 0.

Acceptance notes

  • happy-dom does not match a descendant combinator inside :where() (measured: with dark on the page root, body.matches('.dark *') is true and body.matches(':where(.dark, .dark *)') is false). The dark pin therefore splits the variant's selector list and matches each selector, which is what :where() means. The light-theme control rules out a pin that passes because nothing matches.
  • The S1 pin lives in the slot-claim harness because the flow designer claims the slot from the start (its Configuration), so the toggle is drawn there with nothing selected; the right-slot harness has no page that does.
  • The A1 ablation mutated StudioDesignSurface.tsx on disk for one run and restored it to HEAD (blob proven equal); the diff does not touch that file, nor studioMenuModel.ts or StudioPackageMenu.tsx.
  • origin/main moved to 1af67b26cd after the branch point; the incoming app-shell change (ResourceListPage.tsx and a new record-section module) touches no PageShell prop and none of these files, so the branch was not re-merged.

Verification

Derived gates (dispatch-gates --commands, head b74f7ff)

38 derived commands, every one exit 0, plus pnpm check:changeset-fixed (its roster sits under .changeset) exit 0. dispatch-gates --ran: 38 derived, 38 run, 0 NOT-MEASURED (a derived zero: all 38 recorded an exit code), 0 UNRUN. The ui scripts/ family: Test Files 172 passed | 2 skipped (174). CI families (Test UI, Type Check UI, Lint UI and the rest) are read from this PR's check-runs, not re-run locally.


Generated by Claude Code

…unted accent and its dark scope; PageShell's row draws no lone hairline

- S1: with no copilot served, the slot toggle ends the flow page's title
  row, not the top bar, and hides and shows the slot.
- S2: PageShell's compact and list rows (and their embedded gate), the
  directory header and the diagnostics header end with Save and the
  assistant under Studio; controls outside Studio.
- N1: two surfaces holding the accent on body, one unmounted, keep it.
- N4: under the dark theme the surface root and body match the dark
  variant and carry the accent's dark declarations.
- N3: PageShell passes `divider` from its own stats and actions.

Claude-Session: https://claude.ai/code/session_01Utp6CbL6Nn3scsU8yvLyU4
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbL6Nn3scsU8yvLyU4

Final green head (2026-11-26T12:45Z): b74f7ff4c739f74e04370f8e7f1d2c3ab3de0a79. CI: 51 check-runs completed, 0 failed (Test UI 1–16, Type Check UI, Lint UI, Build & E2E UI, Live E2E UI and Check Changeset all green). Sent to seat repo:objectstack#5 for L1. os-dev report: #37520 comment 7191993931.

Area notes for L1:

  1. The diff adds test pins plus one product change: the N3 divider guard in PageShell.tsx, with a patch changeset for @object-ui/app-shell. Every pin was ablated red (A1–A9 in the report).
  2. The dark pin matches the dark: variant's selectors one at a time, because happy-dom does not match a descendant combinator inside :where(). This is declared in the PR's acceptance notes and not filed.
  3. Declared narrowing: the full app-shell suite was left to CI (green). The branch was not re-merged after main moved, and main's change touches none of this PR's files.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head b74f7ff · 2026-11-26T12:46Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: TIER_DEFAULT
Head-sha: b74f7ff4c739f74e04370f8e7f1d2c3ab3de0a79
Local-runs: none

PR #37542, card #37520 (follow-up of the contract record 7189499173 on PR #37474). Read: the card's body and its three comments (triage 7190492158, claim 7190642371, os-dev report 7191993931), the final-head comment 7192432076 on the PR, the PR body, the net diff against main (7 files, +377/−4), and the record on #37474 that the card cites. Nothing was built, run or ablated. I judged the nine ablations by reading each pin against its mutation.

Check-runs on the head: 51 in total, 38 success and 13 skipped, with none failed or pending. Test UI 1–16, Type Check UI, Lint UI, Build & E2E UI, Live E2E UI, Check Changeset, Check PR Size, PR-body guards and Governed Surface Queue Guard all passed.

Findings, graded:

  • S1 (should-fix): the || !!actions arm of the N3 guard has no pin. Each new N3 case has either no actions, or actions together with Save, and Save brings the hairline on its own. So rowHasOwnControls = (stats?.length ?? 0) > 0 would keep every suite green. One real caller depends on this arm: ResourceEditPage's embedded frame passes actions with no stats and does not pass embedded to PageShell, so its row end draws. The fix is one case: actions with no stats and nothing unsaved, expecting the hairline before the assistant.
  • N1 (nit): !!actions tests whether the ReactNode is truthy. A fragment that is always passed but renders nothing still counts as a control and draws the hairline. No current caller reaches this, because every caller that passes such a fragment also passes stats.
  • N2 (nit): in the N4 pin, the variant-match half holds for any node under html.dark. The behaviour the pin actually holds is the binding in styles.css, plus the dark declarations on the surface root and on body, checked against STUDIO_ACCENT_HSL.dark. Those parts are not tautological: A9 turns the case red.

① Derived judgments

The card's items against the diff.

  • S1, the slot toggle with no copilot: pinned, with a control. The case checks that the toggle is the only one on the page, is absent from the top bar and from the slot, and is the last control in its row behind the hairline. It also checks that clicking it hides and shows the slot, and that aria-pressed and the accessible name follow. If the toggle arm returns null (A1), findByTestId fails. The control serves a copilot and expects the assistant with no toggle. copilot.available is reset in beforeEach.
  • S2, the four unpinned row ends that the feat(studio): Save and Cancel in the item header, the AI assistant at the end of every title row #37474 record named: each is now pinned.
    • PageShell's compact row: the right-aligned group's order is pinned (actions, Save, hairline, assistant). A2 turns 4 cases red.
    • The !embedded gate on both rows: an embedded case gives Save and expects neither Save nor the assistant. Dropping either gate (A3, A4) renders Save, so each case goes red.
    • The directory header: the exact list of testids is pinned, which also holds divider={false}. There is an outside-Studio control.
    • The diagnostics header: the row end is the row's last child and comes after Refresh. There is an outside-Studio control.
  • N1, the accent counter: two mounted, one unmounted, then the last unmounted. Deleting the mountedSurfaces > 0 early return (A8) strips body at the first unmount, so the case goes red. The one-mount control holds.
  • N4, the dark scope: pinned within what jsdom can read (see N2). The happy-dom :where() workaround is declared, and the light control rules out a vacuous pass.
  • N3, the divider guard in PageShell.tsx: correct for every caller. Each caller as the diff leaves it:
    • Outside the Studio surface, StudioTitleRowEnd returns null, so Setup and every bare mount are unchanged.
    • With embedded, no row end is drawn, so the guard does not apply.
    • ResourceListPage (list row), PermissionMatrixEditor's main return (compact row) and ResourceHistoryPage (compact row, in item-tools, outside metadata-admin) always pass stats. The hairline stays as before.
    • PermissionMatrixEditor's loading and draft-refused shells pass no stats and no actions, so they now draw no lone hairline. This is the fix.
    • ResourceEditPage's embedded frame passes actions with no stats, so the hairline is kept. The behaviour is right, but the arm is unpinned (S1 above).
    • Save still brings the hairline through StudioTitleRowEnd's divider || save.
    • DeviceAuthPage's PageShell is an unrelated local component.
  • The nine ablations each turn red as claimed. The guard's actions arm is the only part with no ablation (S1 above).

File surface. The diff stays within the claim's surface: tests under studio-design/** and metadata-admin/**, the N3 hunk in PageShell.tsx, and one changeset. StudioDesignSurface.tsx, studioMenuModel.ts and StudioPackageMenu.tsx are not in the diff. The A1 mutation was on disk only.

Public surface. None changes. PageShell's props are unchanged. Its barrel export MetadataPageShell has no consumer outside app-shell, and @object-ui/app-shell is "private": true.

Main drift. The branch was not re-merged after main moved. The only change on main since the merge base in these view directories is a one-line deletion in ResourceListPage.tsx, outside its PageShell call.

② Semver level

  • The changeset '@object-ui/app-shell': patch is right. The diff changes rendered output in one private UI package and publishes nothing else. Check Changeset passed.
  • Clause-②: no is right, with no arm. The diff widens or narrows no published accept set, and no schema, metadata key or export moves. Metadata-protocol: none is right too, and both lines appear in the changeset body and in the PR body.
  • The changeset text matches the diff: the hairline is drawn when the row has stats, actions or Save, and nothing changes outside Studio.

③ Boundary flags

  1. open_questions: empty.
  2. Out-of-scope note (happy-dom does not match a descendant combinator inside :where()): accepted as noted and not filed. It concerns the test DOM only, the pin works around it in the open, and the light control keeps the pin honest.
  3. Deviations:
    • The commit trailers and PR footer follow AGENTS.md: accepted.
    • The branch was not re-merged: accepted, because the drift touches none of these lines (see ①).
    • The full app-shell suite was left to CI: accepted, because Test UI 1–16 is green on this head.
  4. SQL push-down: not applicable. The diff has no query, no id materialisation and no join.

Implemented-by: claude/issue-37520-studio-title-row-pins
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

席位核对

Head-sha: b74f7ff4c739f74e04370f8e7f1d2c3ab3de0a79
REWORK — L1, seat repo:objectstack#5

  1. Shape: open draft against main, Fixes #37520. 7 files: six tests and PageShell.tsx. Not governed, no narrowing. @object-ui/app-shell patch, Clause-②: no, Metadata-protocol: none. No review face, so the declaration face applies at TIER_DEFAULT.
  2. Premise: S1, S2, N1 and N4 from the feat(studio): Save and Cancel in the item header, the AI assistant at the end of every title row #37474 review are pinned, each with a control. The PageShell divider guard (N3) is correct for every caller.
  3. Gates: contract record 7192526450 reads PASS, with one should-fix. CI on this head: 38 success, 13 skipped, 0 failed.
  4. Owed for the delta (one test case):
    • S1: pin the guard's || !!actions arm. Add one case with actions and no stats, nothing unsaved, and expect the hairline. That is ResourceEditPage's embedded frame, the one real caller of the arm. Without it, rowHasOwnControls = (stats?.length ?? 0) > 0 keeps every suite green. Give the ablation that drops the arm.
    • N1 (a truthy fragment that renders nothing still counts) and N2 (half of the dark pin passes for any node under html.dark) are accepted deviations. No caller hits N1 today.
  5. Out of scope and where it went: none.
  6. Next: push, then knock. The delta reads S1 alone. After ACCEPT, area ux-37424 lands it.

A row with actions of its own and no stats (ResourceEditPage's embedded
frame passes actions without `embedded`) draws the hairline before the
assistant, on the compact and the list row.

Claude-Session: https://claude.ai/code/session_01Utp6CbL6Nn3scsU8yvLyU4
Co-authored-by: Claude <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants